package org.hertsig.magiccardmarket.entities;

import java.util.Date;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlEnum;
import javax.xml.bind.annotation.XmlRootElement;

import lombok.AllArgsConstructor;
import lombok.Delegate;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.ToString;

@Getter @ToString
@AllArgsConstructor @NoArgsConstructor
@XmlRootElement(name="response")
public class Articles implements Iterable<Articles.Article> {
	@Delegate(types=Iterable.class) @XmlElement private List<Article> article;
	
	@Getter @ToString
	@AllArgsConstructor @NoArgsConstructor
	public static class Article {
		@XmlElement private String idArticle;
		@XmlElement private String idProduct;
		@XmlElement private Language language;
		@XmlElement private String comments;
		@XmlElement private Double price;
		@XmlElement private Integer count;
		@XmlElement private Actor seller;
		@XmlElement private Date lastEdited;
		@XmlElement private Condition condition;
		@XmlElement private Boolean isFoil;
		@XmlElement private Boolean isSigned;
		@XmlElement private Boolean isAltered;
		@XmlElement private Boolean isPlayset;
		@XmlElement private Boolean isFirstEd;
	}
	
	@Getter @ToString
	@AllArgsConstructor @NoArgsConstructor
	public static class Language {
		@XmlElement private Integer idLanguage;
		@XmlElement private String languageName;
	}
	
	@XmlEnum @AllArgsConstructor
	public enum Condition {
		MT("Mint"), NM("Near Mint"), EX("Excellent"), GD("Good"), LP("Lightly Played"), PL("Played"), PO("Poor");
		
		@Getter private String conditionName;
	}
}
